"""
_*_ : utf-8 _*_ 
@Time: 2023/11/13 21:13
@Author: LWK
@File: 076_selenium
@Project: demo01
"""
# https://zhuanlan.zhihu.com/p/657757693 Mac安卓谷歌内核驱动

import urllib.request
# 1.导入selenium
from selenium import webdriver

# 2.创建浏览器操作对象（参数是避免浏览器自动关闭）
options = webdriver.ChromeOptions()
options.add_experimental_option('detach', True)
browser = webdriver.Chrome(options=options)

# 3.访问网站
browser.get("http://www.jd.com")

# 获取网页源码
content = browser.page_source
print(content)

#
# url = 'https://www.jd.com/'
#
# res = urllib.request.urlopen(url)
#
# content = res.read().decode('utf-8')
# # 没有id为J_seckill的数据
# print(content)

